#include #include using namespace std; void main() { ifstream fin; fin.open("junk.txt"); //if the open worked if(!fin.fail()) { //use the file cout << "That file was opened" << endl; } else { cout << "File not found" << endl; } fin.close(); }